﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudyWinform
{
    public partial class Index : Form
    {
        //public Index(string account)
        public Index()
        {
            InitializeComponent();

            //label1.Text = "你好" + account;    // 在新界面展示。   label1是Index的私有的
            //  account属于form1，在index中无法直接获取。通过全局类获取
            label1.Text = "你好" + Single.Instance.Account;
        }

        private void Index_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();     // 隐藏主界面后，点击新界面的关闭，关闭整个程序
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int a1 = Convert.ToInt32(textBox1.Text);
            int a2 = Convert.ToInt32(textBox2.Text);
            label4.Text = "总价：" + a1 * a2;
        }
    }
}
